<template>
  <swiper class="bastBanner" :options="swiperOption">
    <swiper-slide
      class="slide"
      v-for="bastBanners in bastBanner"
      :key="bastBanners.id"
    >
      <router-link to="">
        <img :src="bastBanners.img" />
      </router-link>
      
    </swiper-slide>
    <div class="swiper-pagination" slot="pagination"></div>
  </swiper>
</template>

<script>
import { Swiper, SwiperSlide } from "vue-awesome-swiper";
import "swiper/css/swiper.css";

export default {
  name: "swiper-example-fade-effect",
  title: "Fade effect Autoplay",
  components: {
    Swiper,
    SwiperSlide,
  },
  props: {
    bastBanner: Array,
  },
  data() {
    return {
      swiperOption: {
        spaceBetween: 30,
        loop: true,
        effect: "fade",
        autoplay: {
          delay: 3000,
          disableOnInteraction: false,
        },
        pagination: {
          el: ".swiper-pagination",
          clickable: true,
          type:'bullets'  //指示点为 圆点
        },
      },
    };
  },
};
</script>

<style lang="less">
.bastBanner {
  margin-top: 10px;
  height: 154px;

  .swiper-slide {
    background-position: center;
    background-size: cover;

    &.slide {
      img {
        display: block;
        width: 100%;
        height: 100%;
      }
    }
  }
  .swiper-pagination{
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: block;
    width: 100px;
    height: 20px;
    .swiper-pagination-bullet-active{
      background: #ffffff;
    }
  }
}
</style>